<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="../Main/top.jsp"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="/WEB-INF/CustomTag" prefix="customTag"%>

<link href="../js/TableTree4J/tabletree4j.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/TableTree4J/TableTree4J.js"></script> 

<script language="JavaScript">
	
//GridTree
	var gridTree;	
	function showGridTree(){
	//init
		gridTree=new TableTree4J("gridTree","../");	
		gridTree.tableDesc="<table border=\"1\" class=\"listTable\" width=\"100%\" id=\"table1\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\"  bordercolordark=\"#C0C0C0\" bordercolorlight=\"#C0C0C0\" >";	
		var headerDataList=new Array("分类名称","父分类名称","是否为预置分类","所属课程","节点层次","创建者","创建时间","更新时间","操作");
		var widthList=new Array("15%","10%","10%","10%","10%","10%","10%","10%","10%");
		//参数: arrayHeader,id,headerWidthList,booleanOpen,classStyle,hrefTip,hrefStatusText,icon,iconOpen
		gridTree.setHeader(headerDataList,-1,widthList,true,"GridHead","This is a tipTitle of head href!","header status text","","");				
		//设置列样式
		gridTree.gridHeaderColStyleArray=new Array("","","","centerClo");
		gridTree.gridDataCloStyleArray=new Array("","","","centerClo");	
	//add data
		var dataList;
		<s:iterator value="listCourseFileSrcCatePublic" status="stat">
		
		dataList=new Array("<s:property value='courseFileCateName'/>","<s:property value='courseFileCateParentName'/>","<s:property value='isPreCourseCateString'/>","<s:property value='courseName'/>","<s:property value='depth'/>级","<s:property value='author'/>","<s:property value='gmtCreatedString'/>","<s:property value='gmtModifiedString'/>","<div class='br_line'><a href=\"preUpdateCourseFileSrcCatePublic.action?courseFileSrcCatePublic.courseFileCateId=<s:property value='courseFileCateId' />\">编辑</a></div><div class='br_line'><a href=\"deleteCourseFileSrcCatePublic.action?courseFileSrcCatePublic.courseFileCateId=<s:property value='courseFileCateId' />\" onClick=\"return p_del();\">删除</a></div>");
		//参数: dataList,id,pid,booleanOpen,order,url,target,hrefTip,hrefStatusText,classStyle,icon,iconOpen
		
		gridTree.addGirdNode(dataList,<s:property value='courseFileCateId'/>,<s:property value='courseFileCateParentId'/>,null,<s:property value='#stat.getIndex()+1'/>);
		</s:iterator>
	
	//print	
		gridTree.printTableTreeToElement("gridTreeDiv");
	
	}	

	$(document).ready(function(){
		showGridTree();
	});
</script>

<div class="function_title"><span class="t2"><img src="../images/dqwz.gif">当前位置：分类管理(课程公共文件资源)</span></div>
<div class="function_content">

<div class="addItem"><img src="../images/insert_icon.gif"><a href="preInsertCourseFileSrcCatePublic.action">添加分类</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src="../images/edit_icon.png"><a href="../CourseFileSrcPublic/listCourseFileSrcPublic.action?intercept=1">课程公共文件资源管理</a>
<img src="../images/edit_icon.png"><a href="../CourseFileSrcCatePublic/listCourseFileSrcCatePublic.action?intercept=1">课程公共文件分类管理</a>
<img src="../images/return_icon.png"><a href="listCourseFileSrcCatePublic.action?intercept=1">返回树形列表</a>
</div>

<div class="search_function">
<form action="searchListCourseFileSrcCatePublic.action" method="get" name="search_form" id="search_form" >
<input type="hidden" name="intercept" value="1">
<div class="sub_form">分类名称：
  <input type="text" name="courseFileSrcCatePublic.courseFileCateName" id="courseFileSrcCatePublic.courseFileCateName" value="<s:property value='courseFileSrcCatePublic.courseFileCateName' />"></div>
<div class="sub_form">父分类：
<customTag:treeSelectorCoursePublic courseFileCateId="${courseFileSrcCatePublic.courseFileCateParentId}" type="courseFileSrcCatePublic" selectName="courseFileCateParentId" notNeedValidation="false" target="search"></customTag:treeSelectorCoursePublic>
</div>
<div class="sub_form">是否为预置分类：
<select name="courseFileSrcCatePublic.isPreCourseCate">
	<option value="-1">全部</option>
	<s:if test="%{courseFileSrcCatePublic.isPreCourseCate==1}">
		<option value="1" selected='selected'>是</option>
	</s:if>
	<s:else>
		<option value="1">是</option>
	</s:else>
	<s:if test="%{courseFileSrcCatePublic.isPreCourseCate==0}">
		<option value="0" selected='selected'>否</option>
	</s:if>
	<s:else>
		<option value="0">否</option>
	</s:else>
</select>
</div>
<div class="sub_form">所属课程名称：
  <input type="text" name="courseFileSrcCatePublic.courseName" id="courseFileSrcCatePublic.courseName" value="<s:property value='courseFileSrcCatePublic.courseName' />"></div>
<div class="sub_form">创建者：
  <input type="text" name="courseFileSrcCatePublic.author" id="courseFileSrcCatePublic.author" value="<s:property value='courseFileSrcCatePublic.author' />"></div>
<div class="sub_form"><input type="submit" value="搜索" class="button"></div>
</form>
</div>

<div id="gridTreeDiv"></div>

</div>

<%@ include file="../Main/bottom.jsp"%>

